package com.service.impl;

import com.dao.MerchantDao;
import com.entity.Merchant;
import com.entity.view.MerchantView;
import com.entity.vo.MerchantVO;
import com.service.MerchantService;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;

@Service("merchantService")
public class MerchantServiceImpl extends ServiceImpl<MerchantDao, Merchant> implements MerchantService {


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<Merchant> page = this.selectPage(
                new Query<Merchant>(params).getPage(),
                new EntityWrapper<Merchant>()
        );
        return new PageUtils(page);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<Merchant> wrapper) {
        Page<MerchantView> page =new Query<MerchantView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }

    @Override
    public List<MerchantVO> selectListVO(Wrapper<Merchant> wrapper) {
        return baseMapper.selectListVO(wrapper);
    }

    @Override
    public MerchantVO selectVO(Wrapper<Merchant> wrapper) {
        return baseMapper.selectVO(wrapper);
    }

    @Override
    public List<MerchantView> selectListView(Wrapper<Merchant> wrapper) {
        return baseMapper.selectListView(wrapper);
    }

    @Override
    public MerchantView selectView(Wrapper<Merchant> wrapper) {
        return baseMapper.selectView(wrapper);
    }

    @Override
    public List<Map<String, Object>> selectValue(Map<String, Object> params, Wrapper<Merchant> wrapper) {
        return baseMapper.selectValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params, Wrapper<Merchant> wrapper) {
        return baseMapper.selectTimeStatValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectGroup(Map<String, Object> params, Wrapper<Merchant> wrapper) {
        return baseMapper.selectGroup(params, wrapper);
    }




}
